<template>
    <div class="box">
        <img src="../../assets/images/adminIcon.png" class="adminIcon" />
        <div class="content">
            <div class="topModel">
                众成智付展业端
                <img src="../../assets/mini_logo.png" />
                全方位守护您
            </div>
            <div class="isContent">
                <div class="add" @click="navTo('/addService')">
                    <img src="../../assets/images/addfws.png" />
                    新增服务商
                </div>
                <div class="add" @click="navTo('/adminService')">
                    <img src="../../assets/images/glfws.png" />
                    服务商管理
                </div>
                <div class="add" @click="navTo('/rankingList')">
                    <img src="../../assets/images/top.png" />
                    TOP10
                </div>
            </div>
        </div>
        <div class="databgc">
            <div class="data">
                <div class="title">
                    <div class="titContent">
                        <div class="circle"></div>
                        <div class="text">服务商数据</div>
                        <div class="circle"></div>
                    </div>
                </div>
                <div class="first">
                    <div class="left">
                        <div class="number">{{ nums.agentTotal }}</div>
                        <div class="num">
                            <div>
                                <img style="vertical-align: text-top" src="@/assets/index/star.png" />
                                服务商总数
                            </div>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="left">
                        <div class="number">{{ nums.currAgent }}</div>
                        <div class="num">
                            <div>
                                <img style="vertical-align: text-top" src="@/assets/index/star.png" />
                                直属服务商
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="data isData">
                <div class="title">
                    <div class="titContent">
                        <div class="circle"></div>
                        <div class="text">商户数据</div>
                        <div class="circle"></div>
                    </div>
                </div>
                <div class="first once">
                    <div class="left">
                        <div class="number">{{ nums.total }}</div>
                        <div class="num">
                            <div>
                                <img style="vertical-align: text-top" src="@/assets/index/star.png" />
                                商户总数
                            </div>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="left">
                        <div class="number">{{ nums.incr }}</div>
                        <div class="num">
                            <div>
                                <img style="vertical-align: text-top" src="@/assets/index/star.png" />
                                今日新增
                            </div>
                        </div>
                    </div>
                </div>
                <div class="lineBox">
                    <div class="cutLine"></div>
                </div>
                <div class="first second">
                    <div class="left">
                        <div class="number">{{ nums.curr }}</div>
                        <div class="num">
                            <div>
                                <img style="vertical-align: text-top" src="@/assets/index/star.png" />
                                直属商户
                            </div>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="left">
                        <div class="number">{{ nums.currlower }}</div>
                        <div class="num">
                            <div>
                                <img style="vertical-align: text-top" src="@/assets/index/star.png" />
                                下级商户
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup name="index">
import { custTab } from '@/api/agent.ts'
import store from '@/store'

const router = useRouter()
const nums = ref('')
const navTo = url => {
    console.log(url)
    router.push({
        path: url
    })
}
custTab().then(res => {
    nums.value = res.object
})
</script>

<style scoped lang="scss">
.box {
    min-height: 100vh;
    box-sizing: border-box;
    padding: 34px 16px;
    background: url('../../assets/images/adminBg.png') no-repeat top left / 100% 25%;
    .adminIcon {
        position: absolute;
        width: 80px;
        height: 80px;
        right: 0;
        top: 0px;
        z-index: 99;
    }
    .databgc {
        padding: 11px 9px;
        background: #fff;
        margin-top: 20px;
    }
    .content {
        position: relative;
        opacity: 1;
        .topModel {
            display: flex;
            align-items: center;
            padding: 10px 13px;
            background: url('../../assets/images/adminTop.png') no-repeat top left / 100% 100%;
            img {
                width: 23px;
                margin: 0 10px;
            }
        }
        .isContent {
            background-color: #fff;
            width: 100%;
            height: 90px;
            box-shadow: 0px 0px 10px rgba(14, 50, 97, 0.08);
            opacity: 1;
            display: flex;
            justify-content: space-around;

            .add {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                font-size: 13px;
                font-family: PingFang SC;
                font-weight: 400;
                color: #272727;

                img {
                    width: 34px;
                    height: 34px;
                    margin-bottom: 11px;
                }
            }
        }
    }
    .data {
        padding: 15px 21px;
        background-color: #fff;
        border-radius: 0px 0px 6px 6px;
        padding-bottom: 26px;

        .title {
            display: flex;
            align-items: center;
            justify-content: center;

            .titContent {
                display: flex;
                align-items: center;
                justify-content: center;
                opacity: 1;

                .text {
                    margin: 0 12px;
                }
            }

            .circle {
                width: 10px;
                height: 1px;
                background: #000;
                opacity: 1;
            }
        }
        .second {
            margin-top: 0 !important;
        }
        .first {
            display: flex;
            justify-content: space-around;
            margin-top: 22px;
            background: linear-gradient( 180deg, #C5F0FF 0%, #C5F0FF 100%);
            padding: 10px 0;
            border-radius: 12px;
            .left {
                display: flex;
                flex-direction: column;
                align-items: center;

                img {
                    width: 11px;
                    height: 11px;
                    margin-top: 5px;
                    margin-right: 5px;
                }
            }

            .num {
                display: flex;
                align-items: center;
            }

            .number {
                width: 43px;
                // height: 35px;
                display: flex;
                justify-content: center;
                align-items: center;
                // border-bottom: 1px solid #515151;
                font-size: 18px;
                font-family: PingFang SC;
                font-weight: 600;
                color: #000000;
                margin-bottom: 11px;
            }
        }
    }
    .isData {
        .once {
            border-radius: 12px 12px 0 0;
        }
        .second {
            border-radius: 0 0 12px 12px;
        }
    }
}
.lineBox {
    display: flex;
    justify-content: center;
    width: 100%;
    background: #e7ebf7;

    .cutLine {
        opacity: 0.5;
        width: 90%;
        height: 1px;
    }
}

.line {
    width: 0px;
    height: 36px;
    border-left: 1px solid #000000;
    opacity: 1;
}
</style>
